package com.spring.controller;

import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class YourController {
	/**
	 * 支持级联属性：localhost:8088/po
	 * name：chen
	 * address.door:fff
	 * 表单传输参数
	 * @param user
	 * @return
	 */
	@RequestMapping("/po")
	public String testPojo(User user){

		return user.toString();
	}

	/**
	 * RequestMappingHandlerAdapter
	 * AnnotationMethodHandlerAdapter
	 * @param req
	 * @param resp
	 * @return
	 */
	@RequestMapping("/servletApi")
	public  String te(HttpServletRequest req, HttpServletResponse resp){
		System.out.println(req+","+resp);
		return req+","+resp;
	}


}
